package com.shopping_assistant.view;

import com.shopping_assistant.model.OfferViewCounter;
import com.shopping_assistant.model.Person;
import com.shopping_assistant.model.PersonController;
import com.shopping_assistant.model.VisitCounter;
import com.shopping_assistant.model.VisitedShopType;

import android.app.Activity;
import android.os.Bundle;
import android.widget.ArrayAdapter;
import android.widget.ListView;

public class UserPreferencesView extends Activity {

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.user_statistics_view);

		Person activeUser = PersonController.getInstance().getActiveUser();

		ListView shopsView = (ListView) findViewById(R.id.visitedShopsList);
		ListView offersView = (ListView) findViewById(R.id.viewedOffersList);

		ArrayAdapter<VisitedShopType> shopsViewAdapter = new ArrayAdapter<VisitedShopType>(
				this, android.R.layout.simple_list_item_1,
				activeUser.getVisitedShopTypes());
		shopsView.setAdapter(shopsViewAdapter);

		ArrayAdapter<OfferViewCounter> offersViewAdapter = new ArrayAdapter<OfferViewCounter>(
				this, android.R.layout.simple_list_item_1,
				activeUser.getOffersViewed());
		offersView.setAdapter(offersViewAdapter);
	}
}
